package com.qianheng.kit.base.operation;

import lombok.Getter;
import lombok.Setter;

/**
 * 校验结果类
 *
 * @see OperationChecker
 */
@Getter
@Setter
public class CheckResult {
    private boolean success;
    /**
     * 日志信息
     */
    private StringBuilder report;

    public CheckResult() {

    }

    public CheckResult(boolean success) {
        this.success = success;
    }

    public CheckResult(boolean success, String report) {
        this.success = success;
        this.report = new StringBuilder(report);
    }

    public CheckResult(boolean success, StringBuilder report) {
        this.success = success;
        this.report = report;
    }

    public static CheckResult newResultTrue() {
        CheckResult checkResult = new CheckResult();
        checkResult.setSuccess(true);
        return checkResult;
    }

    public static CheckResult newResultFalse() {
        CheckResult checkResult = new CheckResult();
        checkResult.setSuccess(false);
        return checkResult;
    }
}
